package com.swq.java.code.chapter15.code04;

// 这里导入code03的会抛异常，code05的正常执行
import com.swq.java.code.chapter15.code05.Customer;

import java.util.Set;
import java.util.TreeSet;

public class CustomerTester {
    public static void main(String args[]) {
        Set<Customer> set = new TreeSet<Customer>();
        set.add(new Customer("Tom", 15));
        set.add(new Customer("Tom", 20));
        set.add(new Customer("Tom", 15));
        set.add(new Customer("Mike", 15));

        for (Customer customer : set)
            System.out.println(customer.getName() + " " + customer.getAge());
    }
}